<template>
    <div>
        <router-view :Car="list" @sendinfocar="event"></router-view>
        <van-tabbar v-model="active">
            <van-tabbar-item @click="active==0" :class="active===0?'activeStyle':''" replace to="/homepage" icon="wap-home-o">首页</van-tabbar-item>
            <van-tabbar-item @click="active==1" :class="active===1?'activeStyle':''" replace to="/order" icon="shop-o">点餐</van-tabbar-item>
            <van-tabbar-item @click="active==2" :class="active===2?'activeStyle':''" replace to="/car" icon="cart-o">订单</van-tabbar-item>
            <van-tabbar-item @click="active==3" :class="active===3?'activeStyle':''" replace to="/setting" icon="user-o">我的</van-tabbar-item> 
        </van-tabbar>
    </div>
</template>
<script>

export default {
    data(){
        return{
            list:[

            ],
            active:0
        }
    },
    methods:{
       event:function(value){
           for(var i=0;i<value.length;i++){
               var date=new Date();
               {
                   this.list.push({
                       logindate:date,
                       itemName:value[i].itemName,
                       itemSrc:value[i].itemSrc,
                       itemCount:value[i].itemCount,
                       itemPrice:value[i].itemPrice

                   })
               }
           }
        },
       
       
    }
}
</script>
<style scoped>
.activeStyle  {
    color: rgb(255, 255, 255);
    background-color: rgb(30, 25, 22);
}
</style>